package com.zlp.jdkproxy;

import com.zlp.jdkproxy.MyInvocationHandler;
import com.zlp.jdkproxy.Subject;

/**
 * @description: //TODO
 * @author: LiPing.Zou
 * @create: 2020-05-09 22:21
 **/
public class Client {

    public static void main(String[] args) {
        //真实对象
        Subject realSubject = new RealSubject();


        MyInvocationHandler myInvocationHandler = new MyInvocationHandler(realSubject);
        //代理对象
        Subject proxyClass = (Subject) myInvocationHandler.newProxyInstance(myInvocationHandler);
        // Subject proxyClass = (Subject) Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[]{Subject.class}, myInvocationHandler);

        proxyClass.sellBooks();

        proxyClass.speak();


    }

    
}
